<template>
  <div>
    <el-button
      class="border-btn"
      size="small"
      style="margin-bottom: 20px;"
      @click="handlAdd"
    >增加负责产品</el-button>
    <el-table
      :data="tableData"
      header-cell-class-name="table-header"
      size="medium"
      border
      :cell-style="cellStyle"
      @row-click="aloneClick"
    >
      <el-table-column
        type="tags"
        label="编号"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="tags"
        label="产品名称"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="address"
        label="批准文号"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="saleArea"
        label="包装规格"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        type="tags"
        label="可营销终端"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="tags"
        label="负责地区"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="address"
        label="兼职属性"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="saleArea"
        label="交易价"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        type="tags"
        label="兼职期限至"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="tags"
        label="关联兼职合同"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="tags"
        label="负责营销职员"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        prop="address"
        label="状态"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="操作"
        align="center"
      >
        <template #default="{row}">
          <el-button type="text">注册终端</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {reactive, toRefs,} from 'vue'

export default {
  name: 'ProductPrice',
  setup(props, context) {
    var data = reactive({
      tableData: [{ tags: 'qwe' }],
    })

    const handlAdd = () => {}

    const aloneClick = (row, column) => {
      if (column.label === '操作' || column.label === '查看文件') return
    }

    const cellStyle = () => {
      return 'cursor:pointer;'
    }

    return {
      ...toRefs(data),
      handlAdd,
      aloneClick,
      cellStyle,
    }
  },
}
</script>

<style scoped>
/* @import url(); 引入css类 */
</style>
